﻿using System;
using System.ComponentModel.DataAnnotations;
using Xcj.Mes.WholeLine.DataBase.Common;

namespace Xcj.Mes.WholeLine.DataBase.Entity
{
    public class DeviceConfigEntity : BaseEntity
    {
        private string _deviceSn = "Aging-01";
        [Alias("设备编号"), StringLength(32)]
        public string DeviceSn { get => _deviceSn; set { _deviceSn = value?.Trim(); RaisePropertyChanged(); } }

        private string _hostName = Environment.MachineName;
        [Alias("工控主机名称"), StringLength(32)]
        public string HostName { get => _hostName; set { _hostName = value?.Trim(); RaisePropertyChanged(); } }

        // 工控主机接收PLC主动上次数据的IP地址
        private string _hostIP = "192.168.1.111";
        [Alias("主机IP"), StringLength(32)]
        public string HostIP { get => _hostIP; set { _hostIP = value?.Trim(); RaisePropertyChanged(); } }

        private int _hostPort = 6500;
        [Alias("主机端口")]
        public int HostPort { get => _hostPort; set { _hostPort = value; RaisePropertyChanged(); } }

        private string _DataBaseServerIP = "127.0.0.1";
        [Alias("数据库服务器IP"), StringLength(32)]
        public string DataBaseServerIP { get => _DataBaseServerIP; set { _DataBaseServerIP = value?.Trim(); RaisePropertyChanged(); } }

        private int _DataBaseServerPort = 3306;
        [Alias("数据库服务器端口")]
        public int DataBaseServerPort { get => _DataBaseServerPort; set { _DataBaseServerPort = value; RaisePropertyChanged(); } }

        private string _DataBaseName = "ZH_HG_WholeDB";
        [Alias("数据库名"), StringLength(32)]
        public string DataBaseName { get => _DataBaseName; set { _DataBaseName = value?.Trim(); RaisePropertyChanged(); } }

        private string _DataBaseAccount = "sa";
        [Alias("数据库账号"), StringLength(32)]
        public string DataBaseAccount { get => _DataBaseAccount; set { _DataBaseAccount = value?.Trim(); RaisePropertyChanged(); } }

        private string _DataBasePassword = "XCJ123456";
        [Alias("数据库密码"), StringLength(32)]
        public string DataBasePassword { get => _DataBasePassword; set { _DataBasePassword = value?.Trim(); RaisePropertyChanged(); } }

        private string _reportFormsFolder = @"D:\生产数据\报表";
        [Alias("数据报表文件夹"), StringLength(256)]
        public string ReportFormsFolder { get => _reportFormsFolder; set { _reportFormsFolder = value?.Trim(); RaisePropertyChanged(); } }
    }
}
